﻿using RAP.Framework.Libary.DomTemplateBuilder.Attributes;
using RAP.Framework.Libary.DomTemplateBuilder.Handler.StringActions;
using RAP.Framework.Libary.Utils;

namespace RAP.Framework.Libary.DomTemplateBuilder.Element.StringActions
{
	/// <summary>
	/// 集合拼接字符串
	/// </summary>
	[TagHandler( "String.Join", typeof( StringJoinHandler ) )]
	public class StringJoin : StringActionItem
    {
        /// <summary>
		/// 元素的属性，如果为空，则直接连接元素ToString()的结果
        /// </summary>
		public string ElementProperty
        {
            get
            {
				return this.ToString ( "ElementProperty" );
            }
        }

        /// <summary>
		/// 连接字符串
        /// </summary>
		public string Separator
        {
            get
            {
				return this.ToString ( "Separator" );
            }
        }


		public bool IgnoreEmpty
		{
			get
			{
				return this.ToBoolean ( "IgnoreEmpty" );
			}
		}

		public int StartIndex
		{
			get
			{
				return this.ToInt32 ( "StartIndex", 0 );
			}
		}

		public new int Count
		{
			get
			{
				return this.ToInt32 ( "Count", 0 );
			}
		}
    }
}
